#pragma once
#include "MatlabInterface.h"
#include "MatlabMatrix.h"
#include <ANN/ANN.h>

using namespace matlab; 

class KNNGeneralizer; 
class MetricLearner :
	public matlab::MatlabInterface
{
public:
	MetricLearner(KNNGeneralizer* p);
	virtual ~MetricLearner(void);

	void learnTransformation(); 
	void transform(Observation newst, Action a, int dim); 
	void transformInMatlab(ANNpointArray& data, int size, Action a, int dim);

	int learnTransformation(ANNpointArray& data, Observation_type*& targets, int size, int action, int dim); 
	void submitAPCChanges(int action, int dim); 
public:
	KNNGeneralizer* parent; 
	
	MatlabMatrix< MatlabMatrix<double>* >* A; 
	MatlabMatrix< MatlabMatrix<double>* >* pc; 

	MatlabMatrix<double>* threadA; 
	MatlabMatrix<double>* threadPc; 

};
